package SV_IL_DEV;

public class Example {
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String name = req.getParameter("userName");
        File file = new File(System.getProperty("web.root"), name + ".dat");
        try {
            FileOutputStream str = new FileOutputStream(file);
            // ...
            str.close();
        } catch (IOException e) {
            throw new ServletException("Cannot open file " + file + ":" + e.getMessage());
        }
    }
}
